<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>数组去重</title>
	</head>
	<body>
		<script>
			var arr = [-1,2,2,9,0,2,1,-1,9];
			var arr2 = arr.filter(function(element,index,self){
				return self.indexOf(element) === index;
			})
			function arrSort(a,b){
				return a-b;
			}
			console.log(JSON.parse(JSON.stringify(arr2.sort(arrSort))));
		</script>
	</body>
</html>
